package com.bigdata.service.mysql.impl;

import org.springframework.stereotype.Service;

import com.bigdata.model.Result;
import com.bigdata.model.SearchModel;
import com.bigdata.mysql.dao.RmrbtableMapper;
import com.bigdata.mysql.entity.Rmrbtable;
import com.bigdata.mysql.entity.RmrbtableExample;
import com.bigdata.service.mysql.RmrbTableService;
import com.bigdata.service.mysql.base.impl.BaseService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

@Service
public class RmrbTableServiceImpl extends BaseService<RmrbtableMapper, Rmrbtable, RmrbtableExample>
		implements RmrbTableService {

	@Override
	public Result queryPage(SearchModel searchModel) {
		RmrbtableExample example = new RmrbtableExample();
		Page<Rmrbtable> page = PageHelper.startPage(searchModel.getPageNumber(), searchModel.getPageSize());
		dao.selectByExample(example);
		Result result = new Result();
		result.setTotal(page.getTotal());
		result.setPages((long) page.getPages());
		result.setList(page.getResult());
		return result;
	}

}
